export const filterEmpty = ({keepEmpty, originValues}: any) => {
  const params: any = {};
  const values: any = originValues;
  for (const key in values) {
    const value: any = values[key];
    if (value) {
      params[key] = value;
    } else if (keepEmpty) {
      params[key] = "";
    }
  }
  return params;
};
export function parseZoneCode(zoneCode:any) {
  const arr = zoneCode.toString().split('');
  let zeroCount = 0;
  for (let count = arr.length - 1; count > -1; count--) {
    if (arr[count] === '0') {
      zeroCount++;
    } else {
      break;
    }
  }
  if (zeroCount >= 8 && zeroCount < 10) {
    // 市
    return [`${zoneCode}###2`, `${zoneCode}###2`];
  }
  if (zeroCount > 6 && zeroCount < 8) {
    // 县
    return [`${zoneCode.substr(0, 4)}00000000###2`, `${zoneCode}###3`];
  }
  if ((zeroCount === 6)) {
    // 县
    return [`${zoneCode}###3`];
  }
  return [];
}